home *** CD-ROM | disk | FTP | other *** search
/ ...taking it to the Macs! / ...taking it to the Macs!.iso / Extras / ActiveX Mac SDK / ActiveX SDK / Sample Controls / TextEdit / CTextEditControl.h < prev    next >
Encoding:
Text File  |  1996-12-17  |  3.2 KB  |  120 lines  |  [TEXT/CWIE]

  1. // =================================================================================
  2. //
  3. //    CTextEditControl.h                ©1996 Microsoft Corporation All rights reserved.
  4. //
  5. // =================================================================================
  6.  
  7. #ifndef _H_CTextEditControl
  8. #define _H_CTextEditControl
  9. #pragma once
  10.  
  11. #include "CBaseControl.h"
  12. #include "IPlatformControl.h"
  13.  
  14. class CTextEditControl;
  15. class CTextEditBSC;
  16.  
  17. class CTextEditContextInfo :
  18.         public CBaseContextInfo
  19.         
  20. {
  21. public:
  22.     // *** CTextEditContextInfo ***
  23.                 CTextEditContextInfo(CTextEditControl* inControlP, Uint32 ContextID);
  24.     virtual     ~CTextEditContextInfo(void);
  25.  
  26.     // *** CBaseContextInfo methods ***
  27.     virtual ErrorCode    Update(Boolean8 Acquired);
  28.     virtual ErrorCode    Activate(Boolean8 Acquired);
  29.     virtual ErrorCode    Deactivate(Boolean8 Acquired);
  30.  
  31.     // *** CTextEditContextInfo methods ***
  32.     TEHandle            GetTEHandle(void) { return mTextEditH; };
  33.  
  34. private:
  35.     TEHandle            mTextEditH;    
  36. };
  37.  
  38.  
  39. typedef enum
  40. {
  41.     EmptyControlPropertyType    = 0x00,
  42.     TextControlProperty            = 0x01,
  43.     ScrollControlProperty        = 0x02,
  44.     SelectionControlProperty    = 0x04,
  45.     PadControlPropertyType        = 0xffffffff
  46. }
  47. ControlPropertyType;
  48.  
  49.  
  50. typedef struct
  51. {
  52.     Str255                Name;
  53.     IConnectionPoint*    ConnectionPoint;
  54.     IUnknown*            Unknown;
  55.     Uint32                Cookie;
  56. }
  57. PlatformControlInfo;
  58.  
  59.  
  60. class CTextEditControl :
  61.         public CBaseControl,
  62.         public IPlatformControlListener
  63. {
  64. public:
  65. friend class CTextEditContextInfo;
  66.  
  67.     // *** CTextEditControl methods ***
  68.     CTextEditControl(void);
  69.     ~CTextEditControl(void);
  70.     
  71.     //  *** IUnknown methods ***
  72.     STDMETHOD    (QueryInterface)(REFIID inRefID, void** outObj);
  73.     STDMETHOD_    (Uint32,AddRef)(THIS) {return CBaseControl::AddRef();}
  74.     STDMETHOD_    (Uint32,Release)(THIS) {return CBaseControl::Release();}
  75.  
  76.     // *** IControl methods ***
  77.     STDMETHOD (Draw) (THIS_ DrawContext* inContext);
  78.     STDMETHOD (OnContextChange)(THIS_ UInt32 inContextID, ContextCommand inCommand);
  79.     STDMETHOD (GetID)(THIS_ Int32 inBufferSize, Char8* outID);
  80.     STDMETHOD (DoMouse)(THIS_ MouseEventType inMouseET, PlatformEvent* inEvent);
  81.     STDMETHOD (DoKey)(THIS_ KeyEventType inKeyET, Char8 inChar, PlatformEvent* inEvent);
  82.     STDMETHOD (DoIdle)(THIS_ Uint32 IdleRefCon) ;
  83.     STDMETHOD (SetFocus)(THIS_ FocusCommand inCommand, FocusSet inFocus);
  84.  
  85.     //  *** IPersistPropertyBag methods ***
  86.     STDMETHOD (Load)(THIS_ IPropertyBag* PropBag, IErrorLog* ErrorLog);
  87.  
  88.     //  *** IPlatformControlListener methods ***
  89.     STDMETHOD (OnControlValueChange)(THIS_ IUnknown* inSource, Int32 ControlValue);
  90.  
  91. protected:
  92.     // *** protected methods ***
  93.     virtual CBaseContextInfo*    NewContext(Uint32 inContextID);
  94.     void                TouchAllContexts(ControlPropertyType PropertyType);
  95.     void                BeginAttachPlatformControls(void);
  96.     void                ReleaseAllPlatformControls(void);
  97.     void                AttachPlatformControl(PlatformControlInfo* inPCInfo);
  98.     void                ReleasePlatformControl(PlatformControlInfo* inPCInfo);
  99.  
  100.     // *** protected data members ***
  101.     Str255                mID;
  102.     PlatformControlInfo    mScrollBarInfo;
  103.     PlatformControlInfo    mPostButtonInfo;
  104.  
  105.     Handle                mNewText;
  106.     Int16                mScrollLines;
  107.     Int16                mOldScrollPosition;
  108.  
  109.     FocusSet            mOwnedFoci;
  110.     Int16                mStartSelection;
  111.     Int16                mEndSelection;
  112.     Int16                mFont;
  113.     Int16                mSize;
  114.     Int16                mFace;
  115.     Str255                mPostUrl;
  116.     CTextEditBSC*        mPostStream;
  117. };
  118.  
  119. #endif
  120.